<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ title }}</title>
    <link rel="stylesheet" href="/static/css/style.css">
</head>
<body>
    <div class="container">
        <header>
            <h1>商品列表</h1>
        </header>
        
        <main>
            <div class="product-list-container">
                <!-- 分类筛选 -->
                <div class="category-filter">
                    <h3>商品分类</h3>
                    <ul>
                        <li><a href="#" class="active">全部商品</a></li>
                        {% for category in categories %}
                        <li><a href="#">{{ category.name }}</a></li>
                        {% endfor %}
                    </ul>
                </div>
                
                <!-- 商品列表 -->
                <div class="product-grid">
                    {% for product in products %}
                    <div class="product-item">
                        <a href="{% url 'product:detail' product.id %}">
                            <div class="product-image">
                                <!-- 这里可以添加商品图片 -->
                                <div class="placeholder-image">图片</div>
                            </div>
                            <h3>{{ product.name }}</h3>
                            <p class="product-price">¥{{ product.price }}</p>
                            <p class="product-description">{{ product.description|truncatechars:50 }}</p>
                        </a>
                    </div>
                    {% endfor %}
                </div>
            </div>
        </main>
        
        <footer>
            <p>&copy; 2025 超市管理系统 - 商品列表</p>
        </footer>
    </div>
    
    <script src="/static/js/main.js"></script>
</body>
</html>